Repository navigation
feat(integrations): native TinyFish Fetch and Gmail draft creation - #115
Merged
Merged
Conversation
Adds per-user TinyFish Fetch (URL to Markdown) and Gmail draft creation directly in the backend, exposed through Applywell's own MCP server (Fetch-Url, List-Email-Accounts, Create-Email-Draft) and REST API under /api/v1/integrations/**. The AI client still generates resume content and email bodies; no n8n, webhook or external MCP is involved. - AES-256-GCM encryption at rest for API keys and OAuth tokens - TinyFetch: SSRF guard, per-user cache, in-flight dedup, per-minute and daily quotas, bounded retry with backoff and Retry-After, manual-input fallback for blocked/partial pages, content flagged as untrusted - Gmail: OAuth 2.0 + PKCE with gmail.compose only, multiple accounts with profiles, refresh/revoke, MIME HTML + resume PDF read internally from Drive, idempotency ledger that never auto-retries ambiguous outcomes - Drafts are never sent and never change application status - Credential mutations restricted to first-party user sessions Closes #113 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01GfjfbPHrV3NGdTB4ssht2P
…ttings page Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01GfjfbPHrV3NGdTB4ssht2P
Qodana for JVM8 new problems were found
View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
upload-result: trueContact Qodana teamContact us at [email protected]
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #113
Summary
TinyFish Fetch and Gmail draft creation now run inside the backend, and the AI client reaches them through Applywell's own MCP server. The client still writes the resume content and the email body. There is no n8n, webhook or external MCP.
New MCP tools. The names follow the repo's existing
Kebab-Caseconvention, not thefetch_url/create_email_draftnames suggested in the issue:Fetch-Url: reads a URL through the user's TinyFish key and returns Markdown, title, final URL and metadata, plus an untrusted-content notice and amanualInputRequiredfallback.List-Email-Accounts: lists the connected Gmail mailboxes and their profiles (e.g. Java, CSharp).Create-Email-Draft: creates an HTML draft and can attach the application's generated resume PDF.REST endpoints are under
/api/v1/integrations/{tinyfetch,gmail}/**. The full contract is indocs/integrations.md.Design notes
APP_INTEGRATIONS_ENCRYPTION_KEY. Responses only include a masked hint such as••••1234.Retry-After.BLOCKEDorPARTIALso the AI asks the user to paste the content.state. The only scope requested isgmail.compose. Signing in with Google does not grant Gmail access.invalid_granton refresh flags the account for reconnection.EMAIL_DRAFT_OUTCOME_UNKNOWN. It is never retried automatically, so no duplicate drafts.@UserSessionOnly), so an AI client can use the integrations but cannot rewire them.Deploy checklist
APP_INTEGRATIONS_ENCRYPTION_KEY(openssl rand -base64 32).${APP_API_BASE_URL}/api/v1/integrations/gmail/oauth/callbackto the OAuth client's redirect URIs.GMAIL_OAUTH_COMPLETE_URL=https://applywell.hugojava.dev/account.gmail.composeis a restricted scope. While the consent screen is in Testing, only listed test users can connect and refresh tokens expire after 7 days. Public use requires Google verification (see the docs).V39creates 5 new tables. It is additive only.Testing
mvn test -Dtest='com.jobtracker.unit.**.*Test'), including the new suites for the cipher, the SSRF validator, the TinyFetch client, service and quotas, the Gmail client, credentials, accounts, MIME, ledger and drafts, and the MCP tool contract.ddl-auto: validate: startup succeeded and 31 MCP tools were registered.gmail.compose), a forged OAuth state redirecting with an error, and the draft endpoint with no connected account.text,markdownorcontent.Frontend: hugoalves-dev/React-JobApplyTracker (branch
hugo/lucid-allen-thoyxd).Generated by Claude Code